package com.life.wd.result;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Result<T> implements Serializable {
    private Integer code;
    private String msg;
    private T data;

    public static  <T> Result<T> success(Object data) {
        return new Result(200,"success",data);
    }
    public static  <T> Result<T> error(Object data) {
        return new Result(401,"error",data);
    }
}
